﻿using System.Web;

namespace GdNet.Web.Assistants
{
    public static class ApplicationAssistant
    {
        public static bool IsWebContext()
        {
            return (HttpContext.Current != null);
        }

        public static string MapApplicationRootPath()
        {
            return MapVirtualPath("~");
        }

        public static string MapVirtualPath(string virtualPath)
        {
            return HttpContext.Current.Server.MapPath(virtualPath);
        }
    }
}
